Service-now Inegration GuideLines

  1. Service-now Webservice
    1. Bydefault in Service-now for every table there will be SOPA WSDL and Rest endpoints for following operations
    2. For Soap if your table name is “u_customer_table”, the WSDL will be
      1. https://instancename.service-now.com/u_customer_table.do?wsdl
    3. For Rest if your table name is “u_customer_table”, the WSDL will be
      1. https://instancename.service-now.com/api/now/table/u_customer_table
    4. Soap WSDL functions
      1. Insert
      2. update
      3. deleteMultuple
      4. getKeys
      5. deleteRecords
      6. get
      7. getRecords
    5. Rest Endpoints Methods
      1. Post
      2. Get
      3. Put
      4. Delete
  2. Soap Web Service Integration with Third Party Tool (Here we are considering as another service instance is a third party tool)
    1. Whenever we need to integrate with third party tool, we need to request the SOAP WSDL from them.
    2. Once we will get the WSDL from third party tool, we will create SOAP Message in Servicenow.
    3. How to Create Soap Message
      1. System Navigator-->Search Soap Message as below
      2. Image 1
      3. Click on “SOAP Message” Module, you will get all the list of Soap Messages.
      4. Click on “New” UI Action.
      5. Image 2
      6. Here I am using WSDL of incident table as fallows
      7. Image 3
      8. And Save it.
      9. After Save you will get the related link at bottom of the form
      10. Click on that
      11. Image 4
      12. After Clicking on the UI Action : Generate Sample SOAP messages, it will create a WSDL xml and functions and will get one addinfo message at top as fallows.
      13. Image 5
      14. Image 6
      15. Click on the “insert” function in another tab.
      16. Image 7
      17. Select Authentication type as Basic one and select the same profile from reference field in Basic auth Profile and save the record.
      18. Click on the Auto Generated Variables
      19. Image 11
      20. After clicking on that, you will get all the variable in “Variable Substitution” related list
      21. Image 12
      22. Select insert.shortdescription variable and put the some test value as fallows
      23. Image 13
      24. After that click on Test from related link
      25. Image 14
      26. After clicking on Test, you will get the request and response xml on the screen.
      27. Image 15
      28. If you get 200, it means, you have created an incident and in response you will get incident number as well as sys_id.
      29. Now go back to your insert function again.
      30. Click on Preview Script Usages as fallows
      31. Image 16
      32. You will get a code, which you can use in your server side scripting.
      33. Image 17
  3. Rest Web Service Integration with Third Party Tool (Here we are considering as another service instance is a third party tool)
    1. Go through Navigation Search and search Rest
    2. Image 18
    3. Click on New
    4. Image 19
    5. Add the authentication type as a Basic
    6. Image 20
    7. And put values for HTPP Request
    8. Image 21
    9. And save it.
    10. Now create HTTP Method for this Message as below – to create it click on New which is on “HTTP Method” related list
    11. Image 22
    12. You will get new form , then plz fill the values like below
    13. Image 23
    14. Fill the HTTP Request tab
    15. Image 24
    16. Then create HTTP query parameter and content with variable for description ${des}
    17. Image 25
    18. And save it.
    19. Then click on “Auto generate Variables”
    20. Image 26
    21. Then it will create a entry in related list of variable substitution.
    22. Image 27
    23. Put some test value for des variable and then click on TEST
    24. Image 28
    25. After clicking on Test, you will get request and response details.
  4. Http Status Codes
    1. 2xx – Success: IT represents Request was accept successfully.
      1. 200 – Success
      2. 201- Success and record created
      3. 202 – Accepted
    2. 4xx – Error -IT represents the Request was incorrect at client only means requester.
      1. 400 – Bad Request
      2. 401– Authentication Failed
      3. 403 – Forbidden
      4. 404 -Not Found
      5. 405 -Method not Allowed
    3. 5xx -Error -It represents the request was correct but error at Server side.
      1. 500 – Internal Server Error
      2. 502 – Not Implemented
      3. 502 – Bad Gateway
      4. 503 – Service Unavailable
      5. 504- Gateway timeout